//package com.cug.nageoffer.user.util;
//
//import com.cug.nageoffer.model.entity.User;
//import com.cug.nageoffer.user.service.UserService;
//import jakarta.annotation.Resource;
//import org.springframework.stereotype.Component;
//
//import java.util.*;
//
//@Component
//public class RecommendUtil {
//
//    @Resource
//    private UserService userService;
//
//
//    //1.将user表里面所有用户查出来
//    //2.遍历所有用户，将点赞表，收藏表里面该用户的记录中的博客id都找出来，放在一个Set
//    //每遍历完一个用户就存Map里面
//    List<User> users = userService.list();
//    Map<String, Set<Integer>> userToBlogs = new HashMap<>();
//    Map<String, Integer> num = new HashMap<>();
//
//    public void getInteraction(){
////        for(User user:users) {
////            //这个Set存放当前遍历到的用户所交互过的所有博客的id
////            Set<Long> postIds = new HashSet<>();
////            //下面这个blogIdsFromUpvote是用户所有点赞过的博客id
////            List<Integer> blogIdsFromUpvote = upvoteMapper.getBlogIdByUserId(user.getAccount());
////            blogIds.addAll(blogIdsFromUpvote);
////            //下面这个blogIdsFromCollect是用户所有收藏了的博客id
////            List<Integer> blogIdsFromCollect = collectMapper.getAllBlogIdByUserId(user.getAccount());
////            blogIds.addAll(blogIdsFromCollect);
////
////            userToBlogs.put(user.getAccount(),blogIds);
////            num.put(user.getAccount(),blogIds.size());
////
////        }
//    }
//}
